import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule }   from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';


import { RouterModule, Routes }  from '@angular/router';
import { Page }   from './page/page';

import { TableComponent } from './table/table.component';
import { LoginComponent } from './login/login.component';
import { RegisterComponent } from './register/register.component';
import { FormComponent } from "./form/form.component";
import { LayersComponent } from "./layers/layers.component";
import { Layer1Component } from "./layers/layer1/layer1.component";
import { Layer2Component } from "./layers/layer1/layer2/layer2.component";


const appRoutes:Routes = [
    {path: '', redirectTo: 'table', pathMatch: 'full'},
    {path: 'login', component: LoginComponent},
    {path: 'register', component: RegisterComponent},
    {path: 'table', component: TableComponent},
    {path: 'form', component: FormComponent},
    {path: 'layers', component: LayersComponent},
    {path: 'layer1', component: Layer1Component},
    {path: 'layer2', component: Layer2Component},
    {path: '**', component: LoginComponent},
];

@NgModule({
    declarations: [
        AppComponent,
        TableComponent,
        FormComponent,
        LayersComponent,
        Layer1Component,
        Layer2Component,
        LoginComponent,
        RegisterComponent,
        Page
    ],
    imports: [
        BrowserModule,
        RouterModule.forRoot(
            appRoutes,
            {enableTracing: false} // <-- debugging purposes only
        ),
        FormsModule,
        HttpModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule {
}
